package com.sc.ktapplication.common.net

import com.sc.ktapplication.common.net.entity.HttpResponse
import com.sc.ktapplication.common.util.versionmanager.AppUpdateResponse
import com.sc.ktapplication.common.util.versionmanager.UpdateInfo
import com.sc.ktapplication.module.entity.AppUser
import com.sc.ktapplication.module.entity.Equipment
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.*


interface WebApi {


    @GET("customSystem/login/login")
    suspend fun login(@QueryMap map: MutableMap<String,Any>) : HttpResponse<AppUser>

    @GET("/equipment/listEquipment")
    suspend fun getEquipments(@QueryMap map: MutableMap<String,Any>) : HttpResponse<Equipment>

    @POST( "/question/submit")
    suspend fun saveFeedback(@QueryMap params: MutableMap<String, Any>): HttpResponse<Boolean>

    @POST("system/user/updatepsw")
    suspend fun updatePwd(@QueryMap params: MutableMap<String, Any>): HttpResponse<Boolean>

    @POST("http://47.111.67.87:7771/region/weighbridge/api")
    suspend fun checkUpdate(@Body params: MutableMap<String, Any>): AppUpdateResponse<UpdateInfo>

    @GET
    @Streaming
    suspend fun down(@Url url : String): Response<ResponseBody>
}